package com.itheima;

import com.itheima.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Xiao
 * @date 2021/9/11
 */
public class App01 {
    public static void main(String[] args) {
        //1.创建IoC容器对象，加载Spring核心配置文件
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        //2.从IoC容器中获取Bean对象(BookService对象)
        BookService bookService = (BookService) ctx.getBean("bookService");
        //3.调用Bean对象的方法
        bookService.save();
    }
}